//
// Created by MI T on 2024/12/30.
//

#ifndef USBCAMERALIB_IMG_UTIL_H
#define USBCAMERALIB_IMG_UTIL_H

#include "libuvc/libuvc.h"
#include "opencv2/core/mat.hpp"
#include "i_camera_factory.h"

class ImgUtils {

public:
    // 将数据转换为BGR格式
    static uvc_frame_t *any2BGR(uvc_frame_t *inFrame);

    static cv::Mat any2BGR(uint8_t *inFrame, int dataBytes, int format, int width, int height);

    static frame_result_data *bgr2Any(uint8_t *inFrame, int format, uint32_t width, uint32_t height);


private:
    static uvc_frame_t *initOutFrame(uvc_frame_t *inFrame);
};

#endif // USBCAMERALIB_IMG_UTIL_H
